package ioc04;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Author：汤小洋
 * Date：2022-11-22 13:38
 * Description：<描述>
 */
public class Test {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("ioc04/spring.xml");
        SpringBean springBean = (SpringBean) ac.getBean("springBean");
        // System.out.println(springBean);

        // ac.registerShutdownHook(); // 销毁容器

        SpringBean springBean2 = (SpringBean) ac.getBean("springBean");

        System.out.println(springBean == springBean2);
    }
}
